#ifndef LOGIN_DIALOG_H
#define LOGIN_DIALOG_H


#include <QDialog>
#include <QSqlQueryModel>
#include <QItemSelectionModel>

namespace Ui {
class LoginDialog;
}

class LoginDialog : public QDialog
{
    Q_OBJECT

public:
    explicit LoginDialog(QWidget *parent = nullptr);
    ~LoginDialog();

private:
    Ui::LoginDialog *ui;

signals:
         // void show2MainInterface(QString account, int m_interfaceType, int examType, int examPatternType);
    void show2MainInterface(QString account, int equipmentType, int examType, int examPatternType, QHash<QString, QList<int>> faultType);
private:
    //表格模型
    QSqlQueryModel *userInformationSqlQueryModel;
    QItemSelectionModel *userInformationSelection;

    QString m_databaseConnectedName = "mysql_connection";

    int m_equipmentType;
    int m_examType;
    int m_examPatternType;
    QHash<QString, QList<int> > m_faultType;
    /**
     * @brief 去界面棱角化
     */
    void removeInterfaceAngularity();
    /**
     * @brief 初始化设置界面样式
     */
    void initializeSetStyleSheet();
    /**
     * @brief 初始化设置槽函数
     */
    void initializeSetSlots();

public slots:
    /**
     * @brief 初始化登录界面
     * @param interfaceType
     * @param examType
     * @param examPatternType
     */
    void initializeLoginDialog(int equipmentType, int examType, int examPatternType);

    /**
     * @brief initializeLoginDialog
     * @param interfaceType
     * @param examType
     * @param examPatternType
     */
    void initializeLoginDialog(int equipmentType, int examType, int examPatternType, QHash<QString, QList<int>> faultType);
};

#endif // LOGIN_DIALOG_H
